<?php
namespace app\admin\validate;

use think\Validate;

class Single extends Validate
{
    protected $rule = [
        'group|分组' => 'require|max:25',
        'title|标题' => 'require|max:80',
        'path|路径' => 'regex:[A-Za-z0-9_\/]*',
        'tpl|模板' => 'regex:[A-Za-z0-9_-]*',
        'description|摘要' => 'max:255',
        'body|内容' => 'require',
    ];

    protected $scene = [
        'add' => ['group', 'title', 'path', 'tpl', 'description', 'body'],
        'edit' => ['group', 'title', 'path', 'tpl', 'description', 'body'],
    ];
}